<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <!-- 完美视口 -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 3.引入外部的js文件 -->
    <script src="js/1.js"></script>

</head>

<body>

    <!-- 1.标签中写js -->
    <button onclick="alert('字符串')">按钮</button>

</body>

</html>

<!-- 2.在html内部写js -->
<script type="text/javascript">
    // 
    /*  */
    alert("你好");
</script>